import api from '@/utils/api';
import registerServer from '@/utils/register-server';
import request from '@/utils/request';

const {
  rice_run_get,
  rice_stop,
  rice_status,
  varieties_list,
  varieties_detail,
} = api;

const methods = {
  rice_run_get: {
    url: rice_run_get,
    method: 'post',
  },
  rice_stop: {
    url: rice_stop,
    method: 'post',
  },
  rice_status: {
    url: rice_status,
    method: 'get',
  },
  varieties_list: {
    url: varieties_list,
    method: 'post',
  },
  varieties_detail: {
    url: varieties_detail,
    method: 'get',
  },
};

const riceService = registerServer<keyof typeof methods>(methods, request);

export default riceService;
